const express = require("express");
const app = express();
app.use(express.static("./"));


app.get("/sum",(req,res)=>{
	// 接收两个参数：a,b,返回合
	const {a,b} = req.query;
	// {sum:3}
	const obj = {
		sum:a/1+b/1
	}
	res.send(req.query.cb+"("+JSON.stringify(obj)+");")
})
app.get("/my",(req,res)=>{
	res.send(req.query.cb+"({ok:1,msg:'成功'});")
})
app.get("/info",(req,res)=>{
	res.json({
		ok:1,
		msg:"成功"
	})
})
app.listen(80,()=>{
	console.log("success");
})